﻿
namespace MX.Core.Caching.Redis.Sider
{
	public   class Message
	{
		public static Message  Create (MessageType type,
		                               string srcPattern, string srcChannel, byte[] body, int? channelsCount = null)
		{
			return new Message (type, srcPattern, srcChannel, body, channelsCount);
		}

		public MessageType Type { get; private set; }

		public string SourceChannel { get; private set; }

		public string SourcePattern { get; private set; }

		public byte[] Body { get; private set; }

		public int? ChannelsCount { get; private set; }


		public Message (MessageType type, string srcPattern, string srcChannel, byte[] body,
		                int? channelsCount = null)
		{
			Type = type;
			SourceChannel = srcChannel;
			SourcePattern = srcPattern;
			Body = body;
			ChannelsCount = channelsCount;
		}

	}
}
